package com.robosense.datacenter.controller;

import com.robosense.datacenter.biz.center.bo.SysUser;
import com.robosense.datacenter.biz.center.service.SysUserService;
import com.robosense.datacenter.biz.guard.bo.Singer;
import com.robosense.datacenter.biz.guard.service.SingerService;
import com.robosense.datacenter.result.R;
import com.robosense.datacenter.result.ResponseVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/test")
@RestController
public class TestController {

    @Autowired
    private SysUserService sysUserService;
    @Autowired
    private SingerService singerService;

    @GetMapping("/singer/{singerId}")
    public ResponseVO<Singer> getSingerInfoById(@PathVariable("singerId") String singerId) {
        return R.vo(200,"返回成功",singerService.getBySingerId(singerId));
    }
    @GetMapping("/sysUser/{userId}")
    public ResponseVO<SysUser> getUserInfoById(@PathVariable("userId") Long userId) {
        return R.vo(200,"返回成功",sysUserService.getById(userId));
    }
}
